/*  ----------------------------------------------------------------------------
*	This file is part of the AS3This ActionScript 3 library.
*	Author: Steve Jones for G-RAFF <http://www.g-raff.com/>
*	Copyright (c) 2009 raffWorks Ltd.
*	----------------------------------------------------------------------------
*	Please see the notice at the bottom of the code before using or modifying this class.
*/
package com.as3this.ui
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	
	import com.as3this.interfaces.IBaseMenuItem;

	public class BaseMenuItem extends Sprite implements IBaseMenuItem
	{
		private var _action			:String;
		private var _locked			:Boolean = false;
		
		public function BaseMenuItem(x:Number, y:Number, action:String, displayObject:DisplayObject = null)
		{
			super();
			
			this.x = x;
			this.y = y;
			_action = action;
			this.mouseChildren = false;
			this.buttonMode = true;
			
			if (displayObject) createDisplay(displayObject);
		}
		
		public function createDisplay(displayObject:DisplayObject) : void
		{
			addChild(displayObject);
		}
		
		public function highlightItem(state:NavItemState) : void
		{
			switch(state)
			{
				case NavItemState.STATIC :
					showStaticState();
					break;
				case NavItemState.OVER :
					showOverState();
					break;
				case NavItemState.DOWN :
					showDownState();
					break;
			}
		}
		
		public function get action() : String
		{
			return _action;
		}
		
		protected function showStaticState() : void
		{
			// ABSTRACT ONLY
		}
		
		protected function showOverState() : void
		{
			// ABSTRACT ONLY
		}
		
		protected function showDownState() : void
		{
			// ABSTRACT ONLY
		}
	}
}

/*
 *    AS3This is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    AS3This is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with AS3This.  If not, see <http://www.gnu.org/licenses/>.
 */